from  machine import  Pin
import time

class StepperMotorModel4i2i:
    def __init__(self,pInA,pOuA,pInB,pOuB) -> None:
        self.pA1=Pin(pInA)
        self.pA2=Pin(pOuA)
        self.pB1=Pin(pInB)
        self.pB2=Pin(pOuB)
        self.sotp()      
        pass
    def sotp(self):
        self.pA1.value(0)
        self.pA2.value(0)
        self.pB1.value(0)
        self.pB2.value(0)
        pass
    def forward(self):
        self.sotp()
        self.pA1.value(1)
        self.pA2.value(0)
        self.pB1.value(1)
        self.pB2.value(0)
        pass
    def backward(self):
        self.sotp()
        self.pA1.value(0)
        self.pA2.value(1)
        self.pB1.value(0)
        self.pB2.value(1)
        pass
    pass


# stepMotor = StepperMotorModel4i2i(13,12,14,27)
# stepMotor.forward()
# time.sleep(5)
# stepMotor.backward()
# time.sleep(5)
# stepMotor.sotp()